package com.liu.demo.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Slf4j
public class HttpAspect {

    @Pointcut("execution(* com.liu.demo.webapi.StudentRestController.*(..))")
    public void log(){}

//    @Before("log()")
//    public void doBefore(){
//        System.out.println("开始执行list。");
//    }
//
//    @Before("log()")
//    public void doAfter(){
//        System.out.println("执行结束list。");
//    }
//
//    @AfterReturning(returning = "object",pointcut = "log()")
//    public void afterR(Object object){
//        log.info("response = {}",object);
//    }
}
